Contents

Last modified: 2021-11-08 17:02:06
Compiled: Mon Nov 8 17:02:07 2021

1 Load packages

library(GoogleImage2Array)

3 Display images with display.array

display.array show a result as a tiled image.

#display CatImg
display.array(CatImg)

4 Get and Display images (Display = TRUE option)

The images are displayed in tiles by the option of GoogleImage2array function.

#Search by Shiba inu
query <- "Shiba inu"
DogImg <- GoogleImage2array(query, Display = TRUE)

#show info
str(DogImg)
## List of 2
##  $ array: num [1:20, 1:64, 1:64, 1:3] 0.167 0.895 0.352 0 0.152 ...
##  $ query: chr "Shiba inu"

5 Combine two arrays together

#Bind two arrays to one array
ImgDat <- bind.array(CatImg, DogImg)

#show info
str(ImgDat)
## List of 2
##  $ array: num [1:40, 1:64, 1:64, 1:3] 0.0141 0.7029 0.111 0.3398 0.7608 ...
##  $ query: chr [1:2] "persian cat" "Shiba inu"

6 display images as a spiral image

#show images
display.spiral(CatImg)
display images as a spiral image

Figure 1: display images as a spiral image

Session information

## R version 4.1.1 (2021-08-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Catalina 10.15.7
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
## 
## locale:
## [1] ja_JP.UTF-8/ja_JP.UTF-8/ja_JP.UTF-8/C/ja_JP.UTF-8/ja_JP.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] EBImage_4.36.0           GoogleImage2Array_0.99.6 BiocStyle_2.22.0        
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.7          highr_0.9           bslib_0.3.1        
##  [4] compiler_4.1.1      BiocManager_1.30.16 jquerylib_0.1.4    
##  [7] bitops_1.0-7        tools_4.1.1         digest_0.6.28      
## [10] lubridate_1.8.0     jsonlite_1.7.2      evaluate_0.14      
## [13] lifecycle_1.0.1     lattice_0.20-45     png_0.1-7          
## [16] rlang_0.4.12        magick_2.7.3        curl_4.3.2         
## [19] yaml_2.2.1          xfun_0.27           fastmap_1.1.0      
## [22] stringr_1.4.0       httr_1.4.2          knitr_1.36         
## [25] xml2_1.3.2          generics_0.1.1      GlobalOptions_0.1.2
## [28] sass_0.4.0          fftwtools_0.9-11    htmlwidgets_1.5.4  
## [31] locfit_1.5-9.4      grid_4.1.1          spiralize_1.0.3    
## [34] R6_2.5.1            GetoptLong_1.0.5    jpeg_0.1-9         
## [37] rmarkdown_2.11      bookdown_0.24       magrittr_2.0.1     
## [40] htmltools_0.5.2     BiocGenerics_0.40.0 abind_1.4-5        
## [43] rvest_1.0.2         shape_1.4.6         colorspace_2.0-2   
## [46] circlize_0.4.13     tiff_0.1-8          stringi_1.7.5      
## [49] RCurl_1.98-1.5      rjson_0.2.20        crayon_1.4.2